import Vue from 'vue'
import VueCookie from 'vue-cookie'
import ElementUI from 'element-ui'
import VCharts from 'v-charts'
import Icon from 'vue-awesome/components/Icon'
import OpenUtils from './../../plugins/open'
import App from './../../view/majorization/App.vue'
import router from './../../router'
import store from './../../store'

import 'element-ui/lib/theme-chalk/index.css'
import './../../assets/styles/element-reset.scss'
import './../../assets/styles/default.scss'
import './../../assets/styles/animation.scss'
import './../../assets/styles/transition.scss'
import 'vue-awesome/icons'

Vue.use(VueCookie)
Vue.use(ElementUI)
Vue.use(VCharts)
Vue.use(OpenUtils)

Vue.component('icon', Icon)

Vue.directive('focus', {
  // 当绑定元素插入到 DOM 中。

  inserted: function (el) {
    // 聚焦元素
    el.focus()
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#majorizationApp',
  store,
  router,
  render: h => h(App)
})
